package cn.bandeqing.customer.entity;

import cn.bandeqing.customer.req.CustomerSaveOrUpdateReq;
import cn.bandeqing.customer.resp.JsCodeLoginResp;
import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 实体类。
 *
 * @author fugui
 * @since 2023-11-21
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_customer", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMappers({
        @AutoMapper(target = JsCodeLoginResp.class, reverseConvertGenerate = false),
        @AutoMapper(target = CustomerSaveOrUpdateReq.class, convertGenerate = false),
})
public class Customer extends BaseEntity {

    /**
     * 客户自增ID
     */
    @Id(keyType = KeyType.Auto)
    private Long customerId;

    /**
     * 客户昵称
     */
    private String customerNickName;

    /**
     * 客户性别 0=女 1=男
     */
    private CustomerSex customerSex;

    /**
     * 客户手机号
     */
    private String customerPhoneNumber;

    /**
     * 客户头像
     */
    private String customerHeadImgUrl;

    /**
     * 客户小程序openid
     */
    private String customerWechatMiniAppOpenId;

}
